<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('company_admins', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('role_id')->nullable()->index();
            $table->unsignedBigInteger('company_id')->index();
            $table->unsignedBigInteger('admin_id')->default(0);
            $table->string('avatar')->nullable();
            $table->tinyInteger('sex')->default(1);
            $table->string('id_card')->default('/');
            $table->string('idcard_file')->default('');
            $table->date('entry_date')->nullable();
            $table->string('email')->nullable();
            $table->string('edu')->nullable()->default('/');
            $table->string('post')->nullable()->default('/');
            $table->string('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('company_admins');
    }
};
